#coding=utf-8
import urllib
from BeautifulSoup import BeautifulSoup

urlopen = urllib.urlopen

markets_for_short = {'上海':'sh', '深圳':'sz'}

def get_soup(url, encoding='gb18030'):
    content = urlopen(url).read()
    htmltext = content.decode(encoding, 'ignore').encode('u8')
    s = BeautifulSoup(htmltext, fromEncoding='u8')
    return s
